//
//  AppAudioPermission.swift
//  XiaoweHearingAid
//
//  Created by Riven on 2023/5/9.
//

import Foundation
import AVFoundation


open class AppAudioPermission {
    
    // MARK: --- 音频权限
    static func authorizeAudioWith(completion: @escaping (Bool) -> Void) {
        let audioSession = AVAudioSession.sharedInstance()
        
        audioSession.requestRecordPermission() { allowed in
            print("音频权限 AVAudioSession allowed = \(allowed) \n")
            DispatchQueue.main.async {
                if allowed {
                } else {
                    
                }
                completion(allowed)
            }
        }
    }
    
}
